package com.yhb.controller;


import com.yhb.controller.vo.VipGoodVo;
import com.yhb.model.Banner;
import com.yhb.model.Good;
import com.yhb.service.GoodService;
import me.edzh.spring.bootstrap.controller.BaseController;
import me.edzh.spring.bootstrap.model.Response;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;
import java.util.Arrays;

@RequestMapping("/good")
@RestController
public class GoodController extends BaseController {
    @Autowired
    private GoodService goodService;

    @GetMapping("/vip")
    public Response<VipGoodVo> getVipItems() {
        return Response.ok(VipGoodVo.builder()
                .topBanner(Arrays.asList(
                        Banner.builder()
                                .imgUrl("https://public.static.ylmvip.cn/static/client/banner/b3.png")
                                .scheme("yinhebao://webView/inner?eyJ1cmwiOiJodHRwczovL3B1YmxpYy5zdGF0aWMueWxtdmlwLmNuL3N0YXRpYy9jbGllbnQvaHRtbC8zJUU5JTgyJTgwJUU4JUFGJUI3JUU5JTgwJTgxJUU0JUJEJTkzJUU5JUFBJThDVklQLmh0bWwifQ==")
                                .build(),
                        Banner.builder()
                                .imgUrl("https://public.static.ylmvip.cn/static/client/banner/b4.png")
                                .scheme("yinhebao://webView/inner?eyJ1cmwiOiJodHRwczovL3B1YmxpYy5zdGF0aWMueWxtdmlwLmNuL3N0YXRpYy9jbGllbnQvaHRtbC80JUU2JTk2JUIwJUU2JUJGJTgwJUU2JUI0JUJCJUU3JTk0JUE4JUU2JTg4JUI3JUU1JTg1JThEJUU2JTk0JUI2JUU1JUJGJUFCJUU5JTgwJTlGJUU1JTg4JUIwJUU4JUI0JUE2JUU4JUI0JUI5Lmh0bWwifQ==")
                                .build(),
                        Banner.builder()
                                .imgUrl("https://public.static.ylmvip.cn/static/client/banner/b2.png")
                                .scheme("yinhebao://webView/inner?eyJ1cmwiOiJodHRwczovL3B1YmxpYy5zdGF0aWMueWxtdmlwLmNuL3N0YXRpYy9jbGllbnQvaHRtbC8yJUU5JTgyJTgwJUU4JUFGJUI3JUU5JTgwJTgxJUU3JUJBJUEyJUU1JThDJTg1Lmh0bWwifQ==")
                                .build()


                ))

                .middleBanner(Arrays.asList(
                        Banner.builder()
                                .imgUrl("https://public.static.ylmvip.cn/static/client/banner/b1.png")
                                .scheme("yinhebao://webView/inner?eyJ1cmwiOiJodHRwczovL3B1YmxpYy5zdGF0aWMueWxtdmlwLmNuL3N0YXRpYy9jbGllbnQvaHRtbC8xJUU1JTg4JUI3JUU1JThEJUExJUU4JUJFJUJFJUU2JUEwJTg3JUU5JTgwJTgxJUU3JTlBJTg3JUU1JTg2JUEwLmh0bWwifQ==")
                                .build()
                        )
                )

                .vipList(goodService.getVipList())
                .primeVipList(goodService.getPrimeVipList())
                .build());
    }
}
